<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('会员列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>微信openid：</label>
                                <input type="text" name="openId"/>
                            </li>
                            <li>
                                <label>团队编码：</label>
                                <input type="text" name="teamCoding"/>
                            </li>
                            <li>
                                <label>Token：</label>
                                <input type="text" name="accessToken"/>
                            </li>
                            <li>
                                <label>OA会员账号：</label>
                                <input type="text" name="appId"/>
                            </li>
                            <li>
                                <label>用户头像：</label>
                                <input type="text" name="avatar"/>
                            </li>
                            <li>
                                <label>用户名：</label>
                                <input type="text" name="username"/>
                            </li>
                            <li>
                                <label>手机号：</label>
                                <input type="text" name="mobile"/>
                            </li>
                            <li>
                                <label>密码：</label>
                                <input type="text" name="password"/>
                            </li>
                            <li>
                                <label>支付密码：</label>
                                <input type="text" name="paymentPassword"/>
                            </li>
                            <li>
                                <label>推荐人：</label>
                                <input type="text" name="recommend"/>
                            </li>
                            <li>
                                <label>会员等级：</label>
                                <input type="text" name="level"/>
                            </li>
                            <li>
                                <label>当前余额：</label>
                                <input type="text" name="balance"/>
                            </li>
                            <li>
                                <label>金币：</label>
                                <input type="text" name="gold"/>
                            </li>
                            <li>
                                <label>最后登录时间：</label>
                                <input type="text" class="time-input" placeholder="请选择最后登录时间" name="logInTime"/>
                            </li>
                            <li>
                                <label>用户真实姓名：</label>
                                <input type="text" name="source"/>
                            </li>
                            <li>
                                <label>当前状态：1为正常登录，2为禁用：</label>
                                <select name="status">
                                    <option value="">所有</option>
                                    <option value="-1">代码生成请选择字典属性</option>
                                </select>
                            </li>
                            <li>
                                <label>银行卡号：</label>
                                <input type="text" name="card"/>
                            </li>
                            <li>
                                <label>开户银行：</label>
                                <input type="text" name="bank"/>
                            </li>
                            <li>
                                <label>支付宝账号姓名：</label>
                                <input type="text" name="aliName"/>
                            </li>
                            <li>
                                <label>支付宝账号：</label>
                                <input type="text" name="aliUser"/>
                            </li>
                            <li>
                                <label>用户积分：</label>
                                <input type="text" name="integral"/>
                            </li>
                            <li>
                                <label>累计金额(礼包商品)：</label>
                                <input type="text" name="accumulativeAmount"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="manhua:member:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="manhua:member:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="manhua:member:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="manhua:member:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('manhua:member:edit')}]];
        var removeFlag = [[${@permission.hasPermi('manhua:member:remove')}]];
        var prefix = ctx + "manhua/member";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "会员",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'userId',
                    title: '用户id',
                    visible: false
                },
                {
                    field: 'openId',
                    title: '微信openid'
                },
                {
                    field: 'teamCoding',
                    title: '团队编码'
                },
                {
                    field: 'accessToken',
                    title: 'Token'
                },
                {
                    field: 'appId',
                    title: 'OA会员账号'
                },
                {
                    field: 'avatar',
                    title: '用户头像'
                },
                {
                    field: 'username',
                    title: '用户名'
                },
                {
                    field: 'mobile',
                    title: '手机号'
                },
                {
                    field: 'password',
                    title: '密码'
                },
                {
                    field: 'paymentPassword',
                    title: '支付密码'
                },
                {
                    field: 'recommend',
                    title: '推荐人'
                },
                {
                    field: 'level',
                    title: '会员等级'
                },
                {
                    field: 'balance',
                    title: '当前余额'
                },
                {
                    field: 'gold',
                    title: '金币'
                },
                {
                    field: 'logInTime',
                    title: '最后登录时间'
                },
                {
                    field: 'source',
                    title: '用户真实姓名'
                },
                {
                    field: 'status',
                    title: '当前状态：1为正常登录，2为禁用'
                },
                {
                    field: 'card',
                    title: '银行卡号'
                },
                {
                    field: 'bank',
                    title: '开户银行'
                },
                {
                    field: 'aliName',
                    title: '支付宝账号姓名'
                },
                {
                    field: 'aliUser',
                    title: '支付宝账号'
                },
                {
                    field: 'integral',
                    title: '用户积分'
                },
                {
                    field: 'accumulativeAmount',
                    title: '累计金额(礼包商品)'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.userId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.userId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>